home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / Developer University / DUProjects / Graphics / Sources / SOMPart.xh < prev    next >
Encoding:
Text File  |  1996-02-13  |  4.8 KB  |  211 lines  |  [TEXT/MPS ]

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: Liberty1:ODF Dev:Graphics1:Sources:SOMPart.xh.
  5.  * Generated using:
  6.  *     SOM Precompiler somipc: 2.18
  7.  *     SOM Emitter emitxh.dll: 2.33
  8.  */
  9.  
  10. #ifndef SOM_Module_DevUniv_defined
  11. #define SOM_Module_DevUniv_defined 1
  12. #include <som.xh>
  13.  
  14. /*
  15.  * Start of user-defined types:
  16.  */
  17. class SOMClass;
  18. class SOMObject;
  19. class ODFrame;
  20. class ODFacet;
  21. class ODObject;
  22. class ODExtension;
  23. class ODRefCntObject;
  24. class ODPersistentObject;
  25. class ODStorageUnit;
  26. class ODPart;
  27. class ODCanvas;
  28. class ODDragItemIterator;
  29. class ODEmbeddedFramesIterator;
  30. class ODLink;
  31. class ODLinkSource;
  32. class ODObjectSpec;
  33. class ODShape;
  34. class ODStorageUnitView;
  35. class ODTypeList;
  36. class ODTransform;
  37. class ODSession;
  38.  
  39. /*
  40.  * End of user-defined types.
  41.  */
  42. #endif /* SOM_Module_DevUniv_defined */
  43.  
  44. #ifndef SOM_DevUniv_Graphics_xh
  45. #define SOM_DevUniv_Graphics_xh
  46.  
  47. class DevUniv_Graphics;
  48.  
  49. #define DevUniv_Graphics_MajorVersion 0
  50. #define DevUniv_Graphics_MinorVersion 0
  51.  
  52. /*
  53.  * Passthru lines: File: "C.xh", "before"
  54.  */
  55. #if FW_LIB_EXPORT_PRAGMAS
  56. #pragma lib_export on
  57. #endif
  58. class FW_CPart;
  59. #if FW_LIB_EXPORT_PRAGMAS
  60. #pragma lib_export off
  61. #endif
  62.  
  63. /* C++ SOM defs */
  64. #include <somcls.xh>
  65. #include <somcm.xh>
  66.  
  67. /* C++ parent defs */
  68. #ifndef SOM_ODPart_xh
  69. #include <Part.xh>
  70. #endif
  71.  
  72. #ifndef DevUniv_Graphics_API
  73. #define DevUniv_Graphics_API
  74. /*
  75.  * -- The Class API
  76.  */
  77.  
  78. /*
  79.  * Start of user-defined types:
  80.  */
  81.  
  82. /*
  83.  * End of user-defined types.
  84.  */
  85.  
  86. #ifdef OLDIBMSOMAPISUPPORT
  87. #define DevUniv_GraphicsCClassData DevUniv_GraphicsClassData
  88. #define DevUniv_GraphicsNewClass(major,minor) somNewVersionedClassReference(DevUniv_Graphics,major,minor)
  89. #endif
  90.  
  91. /* define xxxMetaClass macro to facilitate (cls ## MetaClass) */
  92. #define DevUniv_GraphicsMetaClass SOMClass
  93.  
  94.  
  95. /* The API to the DevUniv_Graphics class object, and the methods it introduces. */
  96. SOMEXTERN struct DevUniv_GraphicsClassDataStructure {
  97. #ifdef OLDIBMSOMAPISUPPORT
  98.     SOMClass            *classObject;    /* always zero, use somNewClassReference instead */
  99. #else
  100.     long zero;
  101. #endif
  102.     somStaticClassInfo *sci;
  103.     somDToken        instanceDataToken;
  104.     long reserved [3];
  105.     somMToken GetFrameworkPart;
  106.     somMToken NewFrameworkPart;
  107.     somMToken majorversion;
  108. } SOMDLINK DevUniv_GraphicsClassData;
  109.  
  110. #if !defined(DevUniv_Graphics_Class_Source) && !defined(SOM_Module_sompart_Source)
  111. #if PRAGMA_IMPORT_SUPPORTED
  112. #pragma import list DevUniv_GraphicsClassData
  113. #endif
  114. #endif
  115.  
  116.  
  117. /*
  118.  * -- Typedefs and inline method declarations for left path inherited methods
  119.  * -- are omitted because this compilation had -museinheritedmethods in effect
  120.  */
  121.  
  122.  
  123. /*
  124.  * -- Typedefs for DevUniv_Graphics Method Procedures
  125.  */
  126. SOMEXTERN {
  127. typedef FW_CPart*   (* SOMLINK somTD_DevUniv_Graphics_GetFrameworkPart)(DevUniv_Graphics *somSelf, Environment *ev);
  128. typedef FW_CPart*   (* SOMLINK somTD_DevUniv_Graphics_NewFrameworkPart)(DevUniv_Graphics *somSelf, Environment *ev,
  129.         ODPart* partWrapper);
  130. }
  131.  
  132. #endif /* DevUniv_Graphics_API */
  133.  
  134.  
  135. /*
  136.  * -- This emitter treats Method Tokens as Thunks by default.
  137.  * -- Use the sc modifier "nothunks" to change this default
  138.  */
  139. #undef somresolve_
  140. #define somresolve_(obj,mToken) ((somMethodProc*)((void)obj, mToken))
  141.  
  142. /*
  143.  * -- The C++ Wrapper Class for DevUniv_Graphics
  144.  */
  145. class DevUniv_Graphics : public ODPart
  146. {
  147. public:
  148.  
  149. // DevUniv_Graphics::new registers use of the class object, and then uses somNew
  150. // to allocate memory and load the object method table pointer. 
  151. void *operator new(size_t size)
  152. {
  153.     SOM_IgnoreWarning(size);
  154.     // Allocate memory using the default allocator for DevUniv_Graphics, and
  155.     // clear mem & set method table pointer, call basic initialization
  156. #ifdef SOMCHKNULL
  157.     void * __somResult = (void *)
  158.       somNewObject(DevUniv_Graphics);
  159.     SOMCHKNULL(__somResult);
  160.     return __somResult;
  161. #else
  162.     return (void*) somNewObject(DevUniv_Graphics);
  163. #endif
  164. }
  165.  
  166. // DevUniv_Graphics::delete uses the default deallocator for the object's class.
  167. void operator delete(void * obj)
  168. {
  169.     if (obj) {
  170.         SOM_Resolve(obj,SOMObject,somFree)
  171.            ( (SOMObject*) obj );
  172.     }
  173. }
  174.  
  175. /* method: GetFrameworkPart */
  176. FW_CPart*   GetFrameworkPart(Environment *ev)
  177. {
  178.    #ifdef SOMCHKEXCEPT
  179.    FW_CPart* __somResult = 
  180.       SOM_ResolveD(this,DevUniv_Graphics,DevUniv_Graphics,GetFrameworkPart)
  181.     (this,ev);
  182.       SOMCHKEXCEPT;
  183.    return __somResult;
  184. #else
  185.    return SOM_ResolveD(this,DevUniv_Graphics,DevUniv_Graphics,GetFrameworkPart)
  186.     (this,ev);
  187. #endif
  188. }
  189.  
  190. /* method: NewFrameworkPart */
  191. FW_CPart*   NewFrameworkPart(Environment *ev,
  192.         ODPart* partWrapper)
  193. {
  194.    #ifdef SOMCHKEXCEPT
  195.    FW_CPart* __somResult = 
  196.       SOM_ResolveD(this,DevUniv_Graphics,DevUniv_Graphics,NewFrameworkPart)
  197.     (this,ev,partWrapper);
  198.       SOMCHKEXCEPT;
  199.    return __somResult;
  200. #else
  201.    return SOM_ResolveD(this,DevUniv_Graphics,DevUniv_Graphics,NewFrameworkPart)
  202.     (this,ev,partWrapper);
  203. #endif
  204. }
  205.  
  206. };   /* DevUniv_Graphics */
  207.  
  208.  
  209.  
  210. #endif       /* SOM_DevUniv_Graphics_xh */
  211.